package cn.explink.dop.entity.vo;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import cn.explink.dop.enums.pub.EnableEnum;
import cn.explink.eap.core.common.entity.IdEntity;

@Entity
@Table(name = "bd_distribute_strategy")
public class DistributeStrategyVO extends IdEntity implements java.io.Serializable {

	private static final long serialVersionUID = -7406146986081252098L;

	private String name;

	private int isEnable;

	private List<ConditionVO> conditionList;

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "is_enable")
	public int getIsEnable() {
		return this.isEnable;
	}

	@Transient
	public String getIsEnableText() {
		return EnableEnum.getTextByValue(this.isEnable);
	}

	public void setIsEnable(int isEnable) {
		this.isEnable = isEnable;
	}

	@OneToMany(mappedBy = "distributeStrategyVO", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	public List<ConditionVO> getConditionList() {
		return this.conditionList;
	}

	public void setConditionList(List<ConditionVO> conditionList) {
		this.conditionList = conditionList;
	}

}